package com.itheima.dao;

import com.itheima.domain.Announcement;
import com.itheima.domain.Answer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AnnouncementDao {
    @Insert("insert into gonggao values (null, #{concent},#{date})")
    void save(Announcement announcement);

//    @Update("update answer set content = #{content}, is_accept = #{is_accept}, likes = #{likes} where aid = #{aid}")
//    int update(Answer answer);

//    @Delete("delete from answer where aid = #{aid}")
//    int delete(Integer aid);

//    @Select("select * from answer where aid = #{aid}")
//    Answer getById(Integer aid);

    @Select("select * from gonggao ORDER BY date DESC LIMIT 1")
    Announcement getAnnouncement();
}
